﻿using System;
using System.Collections.Generic;
using System.Text;

namespace daSyntaxAnalyser.SyntaxTree
{
    using daBase.Objects;

    public class ObjectDefinitionElement : FullClassDefinitionElement
    {
        public ObjectDefinitionElement(TokenInfo StartInfo, TokenInfo Type, List<IdElement> Parents, List<ISectionElement> Sections, List<TokenInfo> Comments) : base(StartInfo, Type, Parents, Sections, Comments) { }

        public override string ToString()
        {
            return string.Format("object{0}{1}{2}\r\nend",
                (type != null) ? string.Format(" {0}", type) : string.Empty,
                ((parents != null) && (parents.Count > 0)) ? string.Format(" ({0})", parents.Join(", ")) : string.Empty,
                ((sections != null) && (sections.Count > 0)) ? string.Format("\r\n{0}", Tabulate(sections.Join("\r\n"))) : string.Empty);
        }
    }
}
